import request from '@/utils/request'
export const loginApi = (data) => {
    return request({
        url: '/login',
        method: 'post',
        data
    })
}
export const getMenus = () => {
    return request({
        url: '/menus',
        method: 'get'
    })
}
export const getUserList = (data) => {
    return request({
        url: '/users',
        params: data
    })
}
export const addUser = (data) => {
    return request({
        url: '/users',
        method: 'post',
        data
    })
}
export const updateUserStatus = (obj) => {
    // console.log(obj)
    return request({
        url: `/users/${Number(obj.id)}/state/${obj.bool}`,
        method: 'put',

    })
}
export const getUserInfo = (id) => {
    return request({
        url: `/users/${id}`,
        method: 'get'
    })
}
export const updateUserInfo = (obj) => {
    // console.log(obj)
    return request({
        url: '/users/' + obj.id,
        method: 'put',
        data: {
            mobile: obj.mobile,
            email: obj.email
        }
    })
}
export const deleteUser = (id) => {
    return request({
        url: `/users/${id}`,
        method: 'delete'
    })
}
